#include<bits/stdc++.h>
using namespace std;
int n,q,pl[8045];
struct hh{
	int dis,p;
};hh a[8045],b[8005];
bool cmp(hh a,hh b){
	if(a.dis==b.dis) return a.p<b.p;
	else return a.dis<b.dis;
}
int main(){
	freopen("sort.in","r",stdin);
	freopen("sort.out","w",stdout);
	cin>>n>>q;
	for(int i=1;i<=n;++i){
		cin>>a[i].dis;
		a[i].p=i;
		b[i].dis=a[i].dis;
		b[i].p=a[i].p;
	}
	int o,x,y;
	for(int i=1;i<=q;i++){
		cin>>o>>x;
		if(o==1){
			cin>>y;
			a[x].dis=y;
			b[x].dis=y;
		}
		else {
			sort(b+1,b+1+n,cmp);
			for(int j=1;j<=n;j++){
				if(b[j].p==x) cout<<j<<endl;
			//	cout<<j<<b[j].dis<<" "<<b[j].p<<" "<<a[j].dis<<" "<<a[j].p<<" "<<x<<endl;
			}
			for(int j=1;j<=n;j++){
				b[j].dis=a[j].dis;
				b[j].p=a[j].p;
			}
		}
	}
	return 0;
}
/*	
		 
 3 4
3 2 1
2 3
1 3 2
2 2
2 3*/
